﻿<!DOCTYPE html>
<!--[if lte IE 8]>              <html class="ie8 no-js" lang="en">     <![endif]-->
<!--[if IE 9]>					<html class="ie9 no-js" lang="en">     <![endif]-->
<!--[if (gte IE 9)|!(IE)]><!-->
<html class="not-ie no-js" lang="en">
<!--<![endif]-->
<head>
    <link href='http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz|Open+Sans:400,600,700|Oswald|Electrolize' rel='stylesheet' type='text/css' />
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />

    <title>Car Dealer | Home</title>

    <meta name="description" content="" />
    <meta name="author" content="" />

    <link rel="shortcut" href="images/favicon.ico" />
    <link rel="stylesheet" href="css/style.css" media="screen" />
    <link rel="stylesheet" href="css/skeleton.css" media="screen" />
    <link rel="stylesheet" href="sliders/flexslider/flexslider.css" media="screen" />
    <link rel="stylesheet" href="fancybox/jquery.fancybox.css" media="screen" />
    <link href="css/bootstrap.min.css" rel="stylesheet" />
    <script src="js/jquery.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <!-- HTML5 Shiv + detect touch events -->
    <script type="text/javascript" src="js/modernizr.custom.js"></script>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <style>
        fieldset label {
            width: 55px;
        }
    </style>

</head>

<body class="menu-1 h-style-1 text-1">

    <div class="wrap">

        <!-- - - - - - - - - - - - - - Header - - - - - - - - - - - - - - - - -->

        <header id="header" class="clearfix">
            <div style="">

                <button id="bt1" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">登陆</button>
                <button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#Modal">注册</button><br />
                <a href="index.html" id="logo"><img src="images/logo.png" alt="Car Dealer" /></a>
            </div>


            <div class="widget-container widget_search" style="">

                <span class="call"><span>（+86）</span> 18888888888</span><br />

                <span class="adds">北京市海淀区上地七街北京八维研修学院软工教学楼38404</span>

                <form action="#" id="searchform" method="get" >

                <p>
                    <input type="text" id="s" placeholder="Search" />
                    <button type="submit" id="searchsubmit"></button>
                </p>

                </form><!--/ #searchform-->

            </div><!--/ .widget-container-->

               <nav id="navigation" class="navigation">

                <ul>
                    <li class="current-menu-item"><a href="index.html" class="active">首页</a></li>
                    <li>
                        <a href="all-listings.html">买车</a>
                    </li>
                    <li>
                        <a href="blog.html">博客</a>
                        <ul>
                            <li><a href="blog.html">博客</a></li>
                            <li><a href="blog-single.html">博客单</a></li>
                        </ul>
                    </li>
                    <li>
                        <a href="news1.html">新闻</a>
                        <ul>
                            <li><a href="news1.html">新闻时事</a></li>
                            <li><a href="image-and-floats.html">新车上市</a></li>
                        </ul>
                    </li>
                    <li><a href="sales-reps.html">销售代表</a></li>
                    <!--<li>
                        <a href="#">页面</a>
                        <ul>
                           
                            <li><a href="404.html">404 页面</a></li>
                            <li><a href="image-and-floats.html">图像和浮动</a></li>
                            <li><a href="pricing-table.html">定价表</a></li>
                           
                        </ul>
                    </li>-->
                    <li><a href="contact.html">联系人</a></li>

                </ul>

            </nav><!--/ #navigation-->

        </header><!--/ #header-->

        <div class="copyrights">Collect from <a href="http://www.cssmoban.com/">Website Template</a></div>
        <!-- - - - - - - - - - - - - - end Header - - - - - - - - - - - - - - - - -->
        <!-- - - - - - - - - - - - - - Top Panel - - - - - - - - - - - - - - - - -->

        <div class="top-panel clearfix">

            <!-- - - - - - - - - - - Slider轮播图 - - - - - - - - - - - - - -->
            <!--/ #slider-->
            <!-- - - - - - - - - - - end Slider - - - - - - - - - - - - - -->
            <!-- - - - - - - - - - - Search Panel - - - - - - - - - - - - - -->
            <!---->
            <!--/ .main-search-panel-->
            <!-- - - - - - - - - - end Search Panel - - - - - - - - - - - - -->

        </div><!--/ .top-panel-->
        <!-- - - - - - - - - - - - - end Top Panel - - - - - - - - - - - - - - - -->

        <div class="main">

            <!-- - - - - - - - - - - - - - - Container - - - - - - - - - - - - - - - - -->
            <!-- - - - - - - - - - - - - - - Content - - - - - - - - - - - - - - - - -->
            <!--/ #content-->
            <!-- - - - - - - - - - - - - - end Content - - - - - - - - - - - - - - - - -->
            <!-- - - - - - - - - - - - - - - Sidebar - - - - - - - - - - - - - - - - -->
            <!--/ #sidebar-->
            <!-- - - - - - - - - - - - - end Sidebar - - - - - - - - - - - - - - - - -->
            </><!--/.container -->
            <!-- - - - - - - - - - - - - end Container - - - - - - - - - - - - - - - - -->

        </div><!--/ .main-->
        <!-- - - - - - - - - - - - - - - Footer - - - - - - - - - - - - - - - - -->

             <footer id="footer" class="container clearfix">

            <section class="container clearfix">

                <div class="four columns">

                    <div class="widget-container widget_text">

                        <h3 class="widget-title">关于我们</h3>

                        <div class="textwidget">

                            <p class="white">
                                我们是专业的二手车在线交易服务提供商。
                            </p>

                            <p>
                                我们的核心业务涵盖了二手车网络交易、二手车电商零售平台，以及二手车金融衍生服务。我们集团致力于为中国二手车行业的发展做出贡献，利用互联网及移动互联网技术，推动和建立中国未来二手车市场的诚信与高效。
                            </p>

                        </div><!--/ .textwidget-->

                        <a href="#" class="see">阅读更多</a>

                    </div><!--/ .widget-container-->

                </div><!--/ .four .columns-->

                <div class="four columns">

                    <div class="widget-container widget_text">

                        <h3 class="widget-title">我们的时间</h3>

                        <div class="textwidget">

                            <ul class="hours">

                                <li>星期一 <span>8 上午 到 7 下午</span></li>
                                <li>星期二 <span>8 上午 到 9 下午</span></li>
                                <li>星期三 <span>8 上午 到 9 下午</span></li>
                                <li>星期四 <span>8 上午 到 9 下午</span></li>
                                <li>星期五 <span>8 上午 到 9 下午</span></li>
                                <li>星期六 <span>8 上午 到 9 下午</span></li>
                                <li>星期日 <span>休息</span></li>

                            </ul><!--/ .hours-->

                        </div><!--/ .textwidget-->

                    </div><!--/ .widget-container-->

                </div><!--/ .four .columns-->

                <div class="four columns">

                    <div class="widget-container widget_contacts">

                        <h3 class="widget-title">我们的联系人</h3>

                        <ul class="our-contacts">

                            <li class="address">
                                <b>地址：</b>
                                <p>北京市海淀区上地七街</p>
                            </li>
                            <li class="phone">
                                <b>电话:</b>&nbsp;<span>18611306272</span> <br />
                                <b>QQ在线客服:</b><br />
                                <b><img src="images/qq/06.gif" border=0 align=middle><a class='qqb' href='tencent://message/?uin=1798316088&Site=心殤的狼，卻痛入骨髓&Menu=yes'>技术QQ:</a></b><br />
                                <b><img src="images/qq/06.gif" border=0 align=middle><a class='qqb' href='tencent://message/?uin=1007762278&Site=*一杯烈酒&Menu=yes'>业务QQ:</a></b>

                            </li>
                            <li>
                                <b><a target="_blank" href="http://mail.qq.com/cgi-bin/qm_share?t=qm_mailme&email=IBEXGRgTERYQGBhgUVEOQ09N" style="text-decoration:none;">给我写信</a></b><br />

                                <b><a target="_blank" href="http://mail.qq.com/cgi-bin/qm_share?t=qm_mailme&email=IBEXGRgTERYQGBhgUVEOQ09N" style="text-decoration:none;"><img src="http://rescdn.qqmail.com/zh_CN/htmledition/images/function/qm_open/ico_mailme_12.png" /></a></b>

                            </li>

                        </ul><!--/ .our-contacts-->

                    </div><!--/ .widget-container-->

                </div><!--/ .four .columns-->

                <div class="four columns">

                    <div id="gMap"></div>

                </div><!--/ .four .columns-->

                <div class="adjective clearfix">

                    <p class="copyright">版权所有 &copy; 2013. 第二项目组 </p>

                </div><!--/ .adjective-->

            </section><!--/ .container-->

        </footer><!--/ #footer-->
        <!-- - - - - - - - - - - - - - - end Footer - - - - - - - - - - - - - - - - -->

    </div><!--/ .wrap-->
    <!-- 模态框（Modal登陆） -->
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog"
         aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <!-- 模态框内容 -->
            <div class="modal-content">
                <!-- 模态框头 -->
                <div class="modal-header">
                    <!-- 关闭模态框 -->
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                    <!-- 模态框标题 -->
                    <h3 class="modal-title" id="myModalLabel">
                        登陆 <a data-dismiss="modal" data-toggle="modal" data-target="#Modal">注册</a>
                    </h3>
                </div>
                <!-- 模态框填写内容 -->
                <div class="modal-body">
                    <h3 style="padding-top: 20px; padding-bottom: 20px; padding-left: 20px;"><b>账户登录</b></h3>

                    <span class="glyphicon glyphicon-user" style="margin-left: 20px;"></span>
                    <input type="text" class="inputclass" id="zhanghu" name="zhanghu" placeholder="手机" /><br />
                    <span class="glyphicon glyphicon-lock" style="margin-left: 20px;"></span>
                    <input type="password" class="inputclass" id="pwd" name="pwd" placeholder="密码" /><br />
                    <input id="Checkbox1" type="checkbox" style="margin-left: 20px;" />记住密码<br />
                    <button type="button" class="btn btn-default " id="button1" onclick="login()">登陆</button>
                    <h4 style="padding-top: 40px; padding-bottom: 10px; padding-left: 20px;">忘记密码？</h4>
                    <h5 style="padding-top: 20px; padding-bottom: 20px; padding-left: 20px;">别担心，点击<a href="#">这里</a>重置密码</h5>
                    <h5 style="padding-top: 20px; padding-bottom: 20px; padding-left: 20px;">还没有用户？<a href="#" data-target="#Modal">注册新用户</a></h5>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default " data-dismiss="modal">退出</button>
                </div>
            </div>
            <!-- /.modal-content -->
        </div>
        <!-- /.modal-dialog -->
    </div>
    <!-- /.modal -->
    <!-- 模态框（Modal）（注册） -->
    <div class="modal fade" id="Modal" tabindex="-1" role="dialog"
         aria-labelledby="myModalLabel" aria-hidden="true">
        <div class="modal-dialog">
            <!-- 模态框内容 -->
            <div class="modal-content">
                <!-- 模态框头 -->
                <div class="modal-header">
                    <!-- 关闭模态框 -->
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                    <!-- 模态框标题 -->
                    <h3 class="modal-title" id="myModalLabel1">
                        注册 <a data-dismiss="modal" data-toggle="modal" data-target="#myModal">登陆</a>
                    </h3>
                </div>

                <!-- 模态框填写内容 -->
                <div class="modal-body">
                    <h3 style="padding-top: 20px; padding-bottom: 20px; padding-left: 20px;"><b>注册新用户</b></h3>
                    <p style="padding-left: 20px;">请输入个人信息：</p>
                    <span class="glyphicon glyphicon-envelope" style="margin-left: 20px;"></span>
                    <input type="text" class="inputclass" id="phone" name="phone" placeholder="手机" /><br />
                    <p style="padding-left: 20px;">请输入账户信息：</p>
                    <span class="glyphicon glyphicon-lock" style="margin-left: 20px;"></span>
                    <input type="password" class="inputclass" id="upwd" name="upwd" placeholder="密码" /><br />
                    <span class="glyphicon glyphicon-ok" style="margin-left: 20px;"></span>
                    <input type="password" class="inputclass" id="upwd1" name="npwd" placeholder="确认密码" /><br />
                    <input id="Checkbox2" type="checkbox" style="margin-left: 20px;" />我同意<a href="#">服务条款</a>和<a href="#">隐私政策</a><br />
                    <br />
                    <button type="button" id="button2" class="btn btn-default ">注册</button>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default " data-dismiss="modal">退出</button>
                </div>
            </div>
            <!-- /.modal-content -->
        </div>
        <!-- /.modal-dialog -->
    </div>
    <!-- /.modal -->

    <script src="js/jquery-1.10.2.min.js"></script>
    <script>window.jQuery || document.write('<script src="js/jquery-1.10.2.min.js"><\/script>')</script>
    <!--[if lt IE 9]>
        <script src="js/selectivizr-and-extra-selectors.min.js"></script>
    <![endif]-->
    <script src="sliders/flexslider/jquery.flexslider-min.js"></script>
    <script src="http://maps.google.com/maps/api/js?sensor=false"></script>
    <script src="js/jquery.gmap.min.js"></script>
    <script src="js/custom.js"></script>


</body>
</html>

<script>
    //登陆
    function login() {
        var phone = $("#zhanghu").val();
        var pwd = $("#pwd").val();
        if (phone == "") {
            alert("手机号不能为空！");

        }

        else {
            if (pwd == "") {
                alert("密码不能为空！");


            }
            else {

                $.ajax({
                    type: "get",
                    url: "http://localhost:5819/api/Home/GetUsersLogin",
                    data: {
                        UsersNameorTel: phone,
                        UsersPwd: pwd

                    },


                    success: function (d) {
                        alert(d);
                        location.reload();
                    }

                })

            }
        }

    }
    //注册
    $("#button2").click(function () {

        var phone = $("#phone").val();
        var upwd = $("#upwd").val();
        var upwd1 = $("#upwd1").val();
        if (phone == "") {
            alert("手机号码不能为空！");
            return;

        }
        var ph = /^[1]+[3,5,7,8]+\d{9}/
        if (!ph.test(phone)) {
            alert("手机号码不符合验证规则！");
            return;
        }

        if (upwd == "") {
            alert("密码不能为空！");
            return;
        }
        if (upwd1 == "") {
            alert("确认密码不能为空！");
            return;
        }
        if (upwd == upwd1) {
            if ($("#Checkbox2").attr("checked")) {
                $.ajax({
                    type: "get",
                    url: "http://localhost:5819/api/Home/GetUsersRegist",
                    data: {
                        UsersNameorTel: phone,
                        UsersPwd: upwd

                    },


                    success: function (d) {
                        alert(d);
                        location.reload();
                    }

                })
                ////$.get("http://localhost:5819/api/Home/GetUsersRegist", { UsersNameorTel: "admin", UsersPwd: "admin" }, function (d) {
                //    alert(d);

                //})
            }

            else {
                alert("请阅读注册协议！");
            }
        }
        else {
            alert("密码和确认密码不同！");
        }
    })
    //判断有没有登陆
    function bu() {
        var q = window.localStorage;
        id = q.getItem("id");

        if (id == 2) {
            location.href = "all-listings.html"
            q.clear();


        }
        else {
            alert("您还没有登陆");



        }

    }
    //快速查询
    function cha() {
        var GoodsPai = $("#GoodsPai").val();
        var MinPrice = $("#MinPrice").val();
        var MaxPrice = $("#MaxPrice").val();
        var GoodsMileage = $("#GoodsMileage").val();
        var CarsModel = $("#CarsModel").val();
        if (GoodsPai == "") {
            alert("品牌不能为空！");
            return;

        }
        if (MinPrice == "") {
            alert("最低价不能为空！");
            return;

        }
        if (MaxPrice == "") {
            alert("最高价不能为空！");
            return;

        }

        if (GoodsMileage == "") {
            alert("行驶里程不能为空！");
            return;

        }
        if (CarsModel == "") {
            alert("车型不能为空！");

        }

        else {
            $.ajax({
                type: "get",
                url: "http://localhost:5819/api/Goods/GetSelectGoodsList",
                data: {
                    GoodsType: GoodsPai,
                    MinPrice: MinPrice,
                    MaxPrice: MaxPrice,
                    GoodsMileage: GoodsMileage,
                    CarsModel: CarsModel

                },
                success: function (d) {
                    var content = ' '
                    $(d).each(function (i, j) {
                        content += '  <li> '
                        content += '   <a href="#" class="single-image video picture"> '
                        content += '       <img src="' + j.GoodsImage + '" alt="" /> '
                        content += '   </a> '
                        content += '   <a href="#" class="list-meta"> '
                        content += '     <h6 class="title-list-item">' + j.GoodsSet + '</h6> '
                        content += '  </a> '
                        content += '  <div class="detailed"> '
                        content += '    <span class="cost">¥' + j.GoodsPrice + '</span> '
                        content += '    <span>' + j.GoodsSet + '</span> <br /> '
                        content += '   <b>' + j.GoodsMileage + ' 公里</b> '
                        content += '    </div><!--/ .detailed--> '
                        content += '    <a onclick="bu()" class="button orange">Details</a> '
                        content += '  </li> '

                    })
                    $("#count").html(content);
                    location.reload();
                }

            })



        }

    }
</script>
